<template>
  <view class="page-main">
    <wrong-questions :dataList="list"></wrong-questions>
  </view>
</template>

<script>
import WrongQuestions from "../../components/slideQuestions/wrongQuestion.vue";
import {examDetails} from '../../api/index'
export default {
  components: {
    WrongQuestions
  },
  data() {
    return {
      list: [{
        id: '1',
        title: '这是一道单选题',
        problemType: 'SINGLE',
        img: 'https://imgs.699pic.com/images/401/760/322.jpg!list2x.v1',
        score: 5,//分值
        children: [{
          alias: 'A',
          answer: '选项1',
          isSelect: 0 //这个是用来回显的字段(0:未选中；1:选中)(可不传)
        }, {
          alias: 'B',
          answer: '选项2',
          isSelect: 0 //这个是用来回显的字段(0:未选中；1:选中)(可不传)
        }, {
          alias: 'C',
          answer: '选项3',
          isSelect: 0 //这个是用来回显的字段(0:未选中；1:选中)(可不传)
        }],
      }, {
        id: '2',
        title: '这是一道多选题',
        problemType: 'MULTY',
        score: 5,//分值
        children: [{
          alias: 'A',
          answer: '选项1',
          isSelect: 0 //这个是用来回显的字段(0:未选中；1:选中)(可不传)
        }, {
          alias: 'B',
          answer: '选项2',
          isSelect: 0 //这个是用来回显的字段(0:未选中；1:选中)(可不传)
        }, {
          alias: 'C',
          answer: '选项3',
          isSelect: 0 //这个是用来回显的字段(0:未选中；1:选中)(可不传)
        }, {
          alias: 'D',
          answer: '选项4',
          isSelect: 0 //这个是用来回显的字段(0:未选中；1:选中)(可不传)
        }],
      }], //问题列表数据
    }
  },

  onLoad(e){
    this.getDetail(e.id)
    wx.showShareMenu({
				withShareTicket: true,
				menus: ["shareAppMessage", "shareTimeline"]
			})
  },
  methods: {
    getDetail(id){
      examDetails({paperId:id}).then(res=>{
        this.list = res.data.questionsVO
        console.log(res,'解析！！！！');
      })
    },
    //点击提交
    subData(data) {
      console.log('提交的数据：' + JSON.stringify(data))
    }
  }
}
</script>
